//
//  Gpopup.swift
//  GOFM
//
//  Created by siri on 2024/11/8.
//  Copyright © 2024 Glad. All rights reserved.
//

import SwiftUI

import SwiftUI
 
struct PopupView: View {
    
    @State var message: String
    var finish: ((String?) -> ())? = nil
 
    var body: some View {
        VStack {
            Text("登录失败")
                .font(.headline)
            Text(message)
                .foregroundColor(.g_color_extended_lightgrey)
                .frame(alignment: .center)
                .multilineTextAlignment(.center)
                .font(.body)
                .padding()
            
            Divider()
            Button("我知道了") {
                finish?(nil)
            }.frame(maxHeight: 40, alignment: .center)
           
        }
        .frame(maxWidth: 300, maxHeight: 200)
        .background(Color.white)
        .cornerRadius(20)
        .shadow(radius: 20)
    }
}

struct  PopupView_Previews: PreviewProvider {
    static var previews: some View {
        PopupView(message: "密码不正确",finish: {
            _ in
        })
    }
}
